package com.eric.rabbit.entity.work;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * @author:Eric
 * @date:2021/6/28
 */
@Slf4j
@Data
@RabbitListener(queues = "work.queue")
public class WorkReceiver {

    private int instance;

    public WorkReceiver(int i){
        this.instance = i;
    }

    @RabbitHandler
    public void receive(String in){
        log.info("instance{} receive {}",instance,in);

    }
}
